package com.lab.common.enums;

public enum AuditEnum {
    AUDITING(0, "待审批"), FIRST_AUDIT(1, "一级审批完成"), SECOND_AUDIT(2, "审批已完成"), NO_PASS(3, "审批不通过");

    private final Integer code;
    private final String info;

    AuditEnum(Integer code, String info) {
        this.code = code;
        this.info = info;
    }

    public Integer getCode() {
        return code;
    }

    public String getInfo() {
        return info;
    }

    public static AuditEnum getLabStatus(Integer code) {
        for (AuditEnum labStatus : AuditEnum.values()) {
            if (labStatus.getCode().equals(code)) {
                return labStatus;
            }
        }
        return AUDITING;
    }
}
